home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / modeler / points2polys.lwm < prev    next >
Text File  |  1993-12-13  |  1KB  |  57 lines

  1. /* CMD: Points->Polys
  2.  * Convert selected points to single point polygons. Cut whole object.
  3.  * By Arnie Cachelin © 1992,93 NewTek Inc. */
  4.  
  5.  
  6. Version = 1.1
  7. call addlib "LWModelerARexx.port", 0
  8. sysnam = 'Points To Polygons'
  9. signal on error
  10. signal on syntax
  11.  
  12. call sel_mode(USER)
  13. /* call removepols() */ /* This command doesn't create 1-point polygons... */
  14. csurf=CurSurface()
  15. call req_begin sysnam
  16.  
  17. id_txt = req_addcontrol("Convert Object", 'T',"To 1-Point Polygons")
  18. id_srf = req_addcontrol("Surfaces",'R')
  19. if (~req_post()) then do
  20.     call req_end
  21.     exit
  22. end
  23. surf = req_getval(id_srf)
  24. call req_end()
  25. say surf Csurf
  26. if surf~=CSurf then call surface(surf)
  27.  
  28. n = xfrm_begin()
  29. say n
  30. call meter_begin 2*n, 'Transforming 'n' Points'
  31. do i = 1 to n
  32.   Point.i= xfrm_getpos(i)
  33.   say Point.i
  34.   call meter_step
  35.   end
  36. call xfrm_end()
  37. call CUT()
  38. call add_begin()
  39. do i=1 to n
  40.   call add_point Point.i
  41.   call add_polygon i
  42.   end
  43. call add_end()
  44. call remlib "LWModelerARexx.port"
  45. exit
  46.  
  47. syntax:
  48. error:
  49.   call end_all
  50.     t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
  51.     exit
  52.  
  53. PointCount: PROCEDURE
  54.   n=XFRM_BEGIN()
  55.   call END_ALL()
  56.   return n
  57.